package leetcode;

/**
 * 递归反转字符串
 * @author 孙继峰
 * @date 2019/03/17
 */
public class ReverseString {
    public String reverse1(String originStr) {
        if (originStr == null || originStr.length() <= 1) {
            return originStr;
        }
        return reverse1(originStr.substring(1)) + originStr.charAt(0);
    }
    public static void main(String[] args) {
        System.out.println(new ReverseString().reverse1("abcdefghijklmnopqrstuvwxyz"));
    }
}
